/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author George
 */
@Entity
@Table(name = "CARACT_MODELO", catalog = "BDACCELCOM", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CaractModelo.findAll", query = "SELECT c FROM CaractModelo c"),
    @NamedQuery(name = "CaractModelo.findByIdCaracteristica", query = "SELECT c FROM CaractModelo c WHERE c.idCaracteristica = :idCaracteristica"),
    @NamedQuery(name = "CaractModelo.findByDescripcion", query = "SELECT c FROM CaractModelo c WHERE c.descripcion = :descripcion")})
public class CaractModelo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IdCaracteristica")
    private Integer idCaracteristica;
    @Column(name = "Descripcion")
    private String descripcion;
    @JoinColumn(name = "IdModelo", referencedColumnName = "IdModelo")
    @ManyToOne(optional = false)
    private Modelo idModelo;

    public CaractModelo() {
    }

    public CaractModelo(Integer idCaracteristica) {
        this.idCaracteristica = idCaracteristica;
    }

    public Integer getIdCaracteristica() {
        return idCaracteristica;
    }

    public void setIdCaracteristica(Integer idCaracteristica) {
        this.idCaracteristica = idCaracteristica;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Modelo getIdModelo() {
        return idModelo;
    }

    public void setIdModelo(Modelo idModelo) {
        this.idModelo = idModelo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCaracteristica != null ? idCaracteristica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CaractModelo)) {
            return false;
        }
        CaractModelo other = (CaractModelo) object;
        if ((this.idCaracteristica == null && other.idCaracteristica != null) || (this.idCaracteristica != null && !this.idCaracteristica.equals(other.idCaracteristica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.CaractModelo[ idCaracteristica=" + idCaracteristica + " ]";
    }
    
}
